package com.lq.createPattern.factory.simplefactory;

public class SimpleCoffeeFactory {
    public Coffee creatCoffee(String coffeeName){
        Coffee coffee = null;
        if("American".equals(coffeeName)){
            coffee=new AmericanCoffee();
            System.out.println("欢迎品尝美国咖啡");
        }else if("china".equals(coffeeName)){
            coffee=new ChinaCoffee();
            System.out.println("欢迎品尝中国咖啡");
        }else {
            throw new RuntimeException("不好意思，目前店内没有这种咖啡");
        }
        return coffee;
    }
}
